<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    @include('common-css')
    <style>

        .input_box {
            width: 100%;
            height: 40px;
            margin-top: 15px;
            margin-bottom: 15px;
            display: flex;
            justify-content: flex-start;
            align-items: center;
        }

        .input_label {
            width: 120px;
            box-sizing: border-box;
        }

        .reviewer-table {
            margin-top: 15px;
        }

        .status-tag {
            color: #1890ff;
            border: 1px solid #91d5ff;
            border-radius: 3px;
            background: #e6f7ff;
            font-size: 12px;
            padding: 2px 3px;
        }

        .ant-table-tbody > tr > td, .ant-table-thead > tr > th {
            vertical-align: middle;
            line-height: 25px;
        }

        .search_box {
            width: 1000px;
        }

        .search_box input {
            width: 300px;
        }

        .search_box button {
            margin-left: 20px;
        }

        .search_box .ant-select {
            margin-left: 20px;
        }

        .edit-reviewer-table {
            width: 100%;
            line-height: 25px;
        }

        .edit-reviewer-table td {
            padding: 5px;
        }

        .delete-btn-a {
            color: #f5222d
        }
    </style>
</head>
<body>

<div id="app"></div>

<script id="appTemplate" type="x-template">
    <a-locale-provider :locale="antdLocale">
        <div class="container">

            @include('admin.header-tpl')

            <main>
                <div class="common_container">

                    @include('admin.aside-tpl')

                    <div class="common_content admin_common_content">

                        <div>

                            <a-button type="primary" @click="showRoleOperate">添加权限组</a-button>

                        </div>

                        <div style="display: flex; position: relative; margin-top: 10px; align-items: center;">
                            <span style="flex: 1;"></span>
                            <a-input style="width: 300px;" placeholder="搜索" v-model="searchKeyword"/>
                            <a-icon v-if="searchKeyword"
                                    style="position: absolute; top: 8px; right: 8px; color: #aaa; cursor: pointer;"
                                    type="cross"
                                    @click="searchKeyword = ''"/>
                        </div>

                        <a-table class="reviewer-table"
                                 rowKey="id"
                                 size="small"
                                 :columns="RoleColumn"
                                 :dataSource="searchFilterList"
                                 {{--                                 :loading="loadingPageData"--}}
                                 :pagination="{pageSize: 10000, hideOnSinglePage: true, position: 'both', showTotal: total => `共 ${total} 项`}">
                            @include('role.table-slot')
                        </a-table>

                    </div>

                </div>
            </main>

            @include('role.operate')

        </div>
    </a-locale-provider>
</script>

@include('common-js')

@include('admin.header-js')
@include('admin.aside-js')

@include('role.operate-js')

<script>
    var queryParams = parseUrl(location.href).params;

    var reviewerProfFields = {!! json_encode(config('vars.reviewer_prof_fields'), JSON_UNESCAPED_UNICODE) !!}

</script>

<script>
    var app = new Vue({
        el: '#app',
        template: '#appTemplate',
        data: {
            pageData: [],
            loadingPageData: false,

            attendedReviewFilter: '',
            searchKeyword: '',

            editCommissionerDialogVisible: false,
            editingCommissioner: {
                id: '',
                name: '',
                tel: '',
                leading_large_group_id: null,
            },

            largeGroups: [],

            modifyCommissionerPasswordDialogVisible: false,
            modifyCommissionerPasswordModel: {
                id: null,
                new_password: '',
            },

            reviewerProfFields,
            asideSelectedKeys: [queryParams.aside_key],
            antdLocale: antd.locales.zh_CN,
            ...AdminHeader.data,
            ...AdminAside.data,
            ...RoleOperate.data
        },
        created:function () {
            this.initRoles()
        },
        computed: {
            searchFilterList() {
                console.log('pl')
                var projects;
                if (this.searchKeyword) {
                    var q = this.searchKeyword.trim();
                    projects = this.RoleList.filter(project => {
                        var text = project.id + project.title + project.remark;
                        return text.toLowerCase().indexOf(q) != -1
                    })
                } else {
                    projects = this.RoleList
                }
                return projects
            },
        },
        mounted() {

        },
        methods: {

            ...AdminHeader.methods,
            ...AdminAside.methods,
            ...RoleOperate.methods
        }
    })
</script>

</body>
</html>